package org.zizi.util;

public class NumberFormat
{
	public static Double format(Double value)
	{
		if (value == null) return null;
		//return Math.round(value * 100) / (double)100;
		return Math.floor(value * 100) / (double)100;
	}
	
	public static Double format(Double value, int accuracy)
	{
		if (value == null) return null;
		
		double p = Math.pow(10, accuracy);
		//return Math.round(value * p) / (double)p;
		return Math.floor(value * p) / (double)p;
	}
}
